Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports OpenSearch V2 through ES_* environment variables #229

Merged
merged 5 commits into from
May 25, 2024

Conversation

reta
Copy link
Contributor

@reta reta commented May 11, 2024

Add Zipkin Dependencies support of for OpenSearch storage (see please openzipkin/zipkin#3765). Tested with Zipkin 3.4.0-SNAPSHOT locally:

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running zipkin2.dependencies.opensearch.OpensearchDependenciesJobTest
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.468 s -- in zipkin2.dependencies.opensearch.OpensearchDependenciesJobTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- jar:3.3.0:jar (default-jar) @ zipkin-dependencies-opensearch ---
[INFO]
[INFO] --- failsafe:3.2.5:integration-test (integration-test) @ zipkin-dependencies-opensearch ---
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
17:47:14,182 WARN  [main] utility.ConfigurationFileImageNameSubstitutor (ConfigurationFileImageNameSubstitutor.java:31) - Image name testcontainers/ryuk:0.6.0 was substituted by configuration to testcontainers/ryuk:0.3.1. This approach is deprecated and will be removed in the future
[INFO] Running zipkin2.storage.elasticsearch.ITOpensearchDependenciesHeavyV2
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 28.81 s -- in zipkin2.storage.elasticsearch.ITOpensearchDependenciesHeavyV2
17:47:47,238 WARN  [main] utility.ConfigurationFileImageNameSubstitutor (ConfigurationFileImageNameSubstitutor.java:31) - Image name testcontainers/ryuk:0.6.0 was substituted by configuration to testcontainers/ryuk:0.3.1. This approach is deprecated and will be removed in the future
[INFO] Running zipkin2.storage.elasticsearch.ITOpensearchDependenciesV2
[INFO] Tests run: 24, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 68.41 s -- in zipkin2.storage.elasticsearch.ITOpensearchDependenciesV2
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 25, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- failsafe:3.2.5:verify (integration-test) @ zipkin-dependencies-opensearch ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

@codefromthecrypt
Copy link
Member

hmm having to maintain both OS_ and ES_ seems either confusing (here and not the server) or maintenance causing (to have to do both). Is there no way we can heuristically check if the server is OS or not? e.g. via a rest call to the version endpoint?

@reta
Copy link
Contributor Author

reta commented May 13, 2024

e.g. via a rest call to the version endpoint?

I think we could but we need 2 set of dependencie (spark_elasticsearch and spark_opensearch) which are sadly conflicting :((

@codefromthecrypt
Copy link
Member

I mean technically this is annoying yes but we dont necessarily need to pass this problem further. In the main function detect which of the two drivers to use.

opensearch was supposed to be a small amount of effort esp with so few maintainers. it is becoming quite large. we need to reduce what we can as there havent been a large amount of requests for it.

@reta
Copy link
Contributor Author

reta commented May 13, 2024

I mean technically this is annoying yes but we dont necessarily need to pass this problem further. In the main function detect which of the two drivers to use.

Oh I see, we could yeah, following the same approach with / endpoint checking , will try to figure out how we could plug it into the zipkin-dependencies without copy / pasting code.

@codefromthecrypt
Copy link
Member

thanks, yep. we had to do something similar when ES changed the index formatting (speculatively try both)

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

final class ZipkinElasticsearchStorage {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codefromthecrypt what do you think about this way of OS/ES storage detection? (tests are on me, just haven't had time to finish them)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep exactly as I was hoping!

# It extends the default configuration from docker-compose.yml to run the
# zipkin-opensearch2 container instead of the zipkin-mysql container.

version: '2.4'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: probably want to update the README so people can see this is there, also

Copy link
Member

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good work

.password("bar")
.hosts(es.url("").toString());

// temporarily hack-in self-signed until https://github.com/openzipkin/zipkin/issues/1683
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

final class ZipkinElasticsearchStorage {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep exactly as I was hoping!

Signed-off-by: Andriy Redko <[email protected]>
Signed-off-by: Andriy Redko <[email protected]>
@codefromthecrypt codefromthecrypt changed the title Add Zipkin Dependencies support of OpenSearch storage Supports OpenSearch V2 through ES_* environment variables May 25, 2024
@codefromthecrypt
Copy link
Member

I will follow-up with a version bump PR. thanks, @reta!

@codefromthecrypt codefromthecrypt merged commit c2311f9 into openzipkin:master May 25, 2024
8 checks passed
@codefromthecrypt
Copy link
Member

$ git push origin release-3.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants